import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;


public class ComplexTest {

	Complex c1;
	Complex c2;
	
	@Before
	public void setUp() throws Exception {
		c1 = new Complex(1, -1);
		c2 = new Complex(1,1);
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public final void testAdd() {
		Complex result = c1.add(c2);
		System.out.println(result);
		Assert.assertTrue(result.isEqual(new Complex(2, 0)));
	}
	
	@Test
	public final void testMinus() {
		Complex result = c1.minus(c2);
		System.out.println(result);
		Assert.assertTrue(result.isEqual(new Complex(0, -2)));
	}
	
	@Test
	public final void testMulti() {
		Complex result = c1.multi(c2);
		System.out.println(result);
		Assert.assertTrue(result.isEqual(new Complex(2, 0)));
	}
	
	@Test
	public final void testDevide() {
		Complex result = c1.devide(c2);
		System.out.println(result);
		Assert.assertTrue(result.isEqual(new Complex(0, -1)));
	}

}
